package com.ktg.mes.erpInventoryCat.controller;

import com.ktg.common.core.domain.AjaxResult;
import com.ktg.mes.erpInventoryCat.service.IErpInventoryCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Description: ERP-存货档案分类
* @Author: jeecg-boot
* @Date:   2022-08-20
* @Version: V1.0
*/
@Api(tags="ERP-存货档案分类")
@RestController
@RequestMapping("/inventoryCatErp/inventoryCat")
@Slf4j
public class ErpInventoryCatController {


   @Autowired
   private IErpInventoryCategoryService iErpInventoryCategoryService;

   /**
    *   从ERP同步存货档案
    *
    * @param
    * @return
    */
//   @AutoLog(value = "从ERP同步存货档案分类")
   @ApiOperation(value="从ERP同步存货档案分类", notes="从ERP同步存货档案分类")
   @PostMapping(value = "/syncDataFromErp")
   public AjaxResult syncDataFromErp() {
       try {
           iErpInventoryCategoryService.syncDataListFromErp();
       }catch (Exception ex){
           log.error("同步ERP 信息出错",ex);
           return AjaxResult.error("同步失败，系统异常！");

       }
       return AjaxResult.success("同步成功！");
   }



}
